{include file="include:header" /}
<!-- 首页 -->
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Css/index.css" />
<body>

        <div class="main-hd">
            <div class="page-teb" >
                <div class="l-tab-content" style="height:851px;">
                    <div class="tab-content-item">
                        <div class="home">
                            <!--成交金额-->
                            <div class="space-style">
                                <div class="col-xs">
                                    <a  href="#" class="title-button bg-deep">
                                        <div class="carousel">
                                            <div class="left-img">
                                                <i><img src="__PUBLIC__/Images/left-img1.png"></i>
                                                <p>订单金额</p>
                                            </div>
                                            <div class="right-info">{$data['order_sum']}元</div>
                                        </div>
                                    </a>
                                </div>

                                <div class="col-xs">
                                    <a  href="#" class="title-button bg-red">
                                        <div class="carousel">
                                            <div class="left-img bg-color-red">
                                                <i><img src="__PUBLIC__/Images/left-img2.png"></i>
                                                <p>订单</p>
                                            </div>
                                            <div class="right-info">{$data['order_count']}笔</div>
                                        </div>
                                    </a>
                                </div>

                                <div class="col-xs">
                                    <a  href="#" class="title-button bg-green">
                                        <div class="carousel">
                                            <div class="left-img bg-color-green">
                                                <i><img src="__PUBLIC__/Images/left-img3.png"></i>
                                                <p>总用户量</p>
                                            </div>
                                            <div class="right-info">{$data['user_count']}</div>
                                        </div>
                                    </a>
                                </div>

                                <div class="col-xs">
                                    <a  href="#" class="title-button bg-orange">
                                        <div class="carousel">
                                            <div class="left-img bg-color-orange">
                                                <i><img src="__PUBLIC__/Images/left-img4.png"></i>
                                                <p>待处理</p>
                                            </div>
                                            <div class="right-info">{$data['dispose_count']}条</div>
                                        </div>
                                    </a>
                                </div>

                             <!--   <div class="col-xs">
                                    <a  href="#" class="title-button bg-purple">
                                        <div class="carousel">
                                            <div class="left-img bg-color-purple">
                                                <i><img src="__PUBLIC__/Images/left-img5.png"></i>
                                                <p>留言</p>
                                            </div>
                                            <div class="right-info">48条</div>
                                        </div>
                                    </a>
                                </div>

                                <div class="col-xs">
                                    <a  href="#" class="title-button bg-yellow">
                                        <div class="carousel">
                                            <div class="left-img bg-color-yellow">
                                                <i><img src="__PUBLIC__/Images/left-img6.png"></i>
                                                <p>紧急通知</p>
                                            </div>
                                            <div class="right-info">2条</div>
                                        </div>
                                    </a>
                                </div>-->
                            </div>

                            <!--折线图-->
                        
                            <div class="panel panel-default home-goods panel" >
                                                    <div class="panel-body">
                                                     <h3 id="ec-month-title" class="ec-title form-horizontal form-inline" style="display: inline-block">
                                                           {$betime}用户增涨
                                                        </h3>
                                                        <div id="ec-month" style="width:100%;height:320px;"></div>
                                                    </div>
                                                </div>
                            </div>
                               
                         

                            <!--销售情况-->
                            <div class="order-form">
                                <div class="col-xs-3 col-lg-7">
                                    <div class="admin-info">
                                        <div class="title-name">
                                            <i></i>
                                            当日订单
                                            <a href="{:url('admin/Order/order_list')}">+更多</a>
                                        </div>
                                        <table class="record-list">
                                            <tbody>

                                            <tbody>
                                            {volist name="data_list['list']" id="v"}
                                            <tr>
                                                <td><a href="{:url('admin/Order/order_details',array('order_id'=>$v['order_id']))}">{$v['o_no']}</a></td>
                                                <td>{if condition="$v['o_type_id'] eq 1"}律师函{else/}企业劳动风险防范专项套餐{/if}<font color="red">({$v['o_money']})</font></td>
                                            </tr>
                                            {/volist}

                                            </tbody>
                                        </table>
                                    </div>
                                </div>

                                <div class="col-xs-6 ranking-style">
                                    <div class="frame">
                                        <div class="title-name">
                                            <i></i>
                                            当日咨询
                                            <a href="{:url('admin/Consul/consult_list')}">+更多</a>
                                        </div>
                                        <table class="table table-list">
                                            <thead>
                                            <tr>
                                                <th width="50">id</th>
                                                <th>咨询标题</th>
                                                <th>咨询类型</th>
                                                <th width="150">咨询时间</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            {volist name="data_list['consult_list']" id="vo"}
                                            <tr>
                                                <td>
                                                    <em>{$vo['consult_id']}</em>
                                                </td>
                                                <td><a href="{:url('admin/Consul/consult_datals',array('consult_id'=>$vo['consult_id']))}">{$vo['ct_title']}</a></td>
                                                <td>{$vo['ct_name']}</td>
                                                <td>{$vo['ct_addtime']}</td>
                                            </tr>
                                            {/volist}
                                            </tbody>
                                        </table>
                                    </div>
                                </div>


                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
</body>
</html>
{include file="include:js" /}

<!-- 统计图表 -->
<script type="text/javascript">
    /*
     *  获取当前年月
     */
    var myDate = new Date();
    var nowYear = myDate.getFullYear(); //获取完整的年份(4位,1970-????)
    var nowMonth = myDate.getMonth();



    /*
     * 按月统计
     */
   
    var myChart_as = echarts.init(document.getElementById('ec-month'));
    // 显示标题，图例和空的坐标轴
          var option_as = {
                    title : {
                        text: ''
                    },
                    tooltip : {
                        trigger: 'axis'
                    },
                    legend: {
                        data:['用户']
                    },
                    grid: {
                        left: '3%',
                        right: '4%',
                        bottom: '3%',
                        containLabel: true
                    },
                    toolbox: {
                        show : true,
                        feature : {
                            mark : {show: true},
                            dataView : {show: true, readOnly: false},
                            magicType : {show: true, type: ['line', 'bar']},
                            restore : {show: true},
                            saveAsImage : {show: true}
                        }
                    },
                    calculable : true,
                    xAxis : [
                        {
                            type : 'category',
                            boundaryGap : false,
                            data : []
                        }
                    ],
                    yAxis : [
                        {
                            type : 'value',
                            axisLabel : {
                                formatter: '{value}'
                            }
                        }
                    ],
                    series : [
                        {
                            name:'用户',
                            type:'line',
                            data:[]
                        }
                    ]
                };
        

         var  year_name      = '设备',    
                year_name_as = '用户';
      
           myChart_as.setOption(option_as); 
           myChart_as.showLoading(); 
    
           getChaxunAs(nowYear,year_name_as); 
             //月
           function getChaxunAs(a,year_name,luna){
                $.get(tp5_url+'ap/indexCount',{age:a,luna:luna}).done(function (data) {
                    if(data.code == '10008'){
                            layer.msg(data.msg,{time: 1500});
                    }else{
                         myChart_as.hideLoading();
                        // 填入数据
                         myChart_as.setOption({
                            xAxis: {
                                data: data.data.chars
                            },
                            series: [
                                {
                                    name: year_name,
                                    data: data.data.count
                                }
                            
                            ]
                        });
                    }
                });
          }   
   
</script>